package ThreadDemo;

import java.util.Random;

public class Consumer implements Runnable {
    Random random = new Random();
    public WareHouse wh;//模拟仓库
    public int name;
    public Consumer(WareHouse wa,int name) {
        this.wh = wa;
        this.name = name;
    }
    public void run() {
        for(int i=0;i<20;i++) {
            int getnumber = random.nextInt(500);
            wh.get(getnumber);
        }
    }
}
